package com.springboot.study.tests.designpattern.state;

/**
 * @Author: guodong
 * @Date: 2021/5/8 16:29
 * @Version: 1.0
 * @Description:
 */
public class StateClient {

    public void buyKeyboard() {
        //状态的保持与切换者
        JdLogistics jdLogistics = new JdLogistics();

        //接单状态
        LogisticsState orderState = new OrderState();
        jdLogistics.setLogisticsState(orderState);
        jdLogistics.doAction();

        //出库状态
        LogisticsState productOutState = new ProductOutState();
        jdLogistics.setLogisticsState(productOutState);
        jdLogistics.doAction();
    }

    public static void main(String[] args) {
        new StateClient().buyKeyboard();
    }

}